﻿using System;
using System.Collections.Generic;
using System.Text;
using MultiGed2;

namespace Topologie_Test
{
 class Program
 {
  static void testTrasy(Oblast o, byte idZ, byte idDo)
  {
   List<Oblast.Trasa> trasy;
			trasy = o.FindPath(idZ, idDo);
   foreach (Oblast.Trasa t in trasy) { 
    Console.WriteLine(o.popisTrasy(o.FormalizujTrasu(t), (byte)Rychlosti.V100, VlDruh2.R)); 
   }
   Console.WriteLine("-------------------");
  }

  static void Main(string[] args)
  {
   {
    Oblast o = new Oblast();
    if (
     o.AddStanica(new Stanica(1, 'A', "Aaa", "Adamov", true)) &&
     o.AddStanica(new Stanica(2, 'B', "Bbb", "Bavorov", true)) &&
     o.AddStanica(new Stanica(3, 'C', "Ccc", "Cebiv", true)) &&
     o.AddStanica(new Stanica(4, 'D', "Ddd", "Dalovice", true)) &&
     o.AddStanica(new Stanica(5, 'E', "Eee", "Ejpovice", false, true, false)) &&
     o.AddStanica(new Stanica(6, 'F', "Fff", "Fulnek", true)) &&
     // ---
     o.AddKolej(new Oblast.TratKol(1, 2, true, true)) &&
     o.AddKolej(new Oblast.TratKol(2, 1, false, false)) &&
     o.AddKolej(new Oblast.TratKol(2, 3, true, true)) &&
     o.AddKolej(new Oblast.TratKol(3, 2, false, false)) &&
     o.AddKolej(new Oblast.TratKol(2, 3, true, false)) &&
     o.AddKolej(new Oblast.TratKol(3, 2, true, false)) &&
     o.AddKolej(new Oblast.TratKol(3, 6, true, true)) &&
     o.AddKolej(new Oblast.TratKol(6, 3, false, false)) &&
     o.AddKolej(new Oblast.TratKol(2, 4, true, true)) &&
     o.AddKolej(new Oblast.TratKol(4, 2, false, false)) &&
     o.AddKolej(new Oblast.TratKol(4, 5, true, true)) &&
     o.AddKolej(new Oblast.TratKol(5, 4, false, false)) &&
     o.AddKolej(new Oblast.TratKol(5, 6, true, true)) &&
     o.AddKolej(new Oblast.TratKol(6, 5, false, false)))
    {
     testTrasy(o, 1, 6);
     testTrasy(o, 4, 6);
     testTrasy(o, 5, 6);
    }
    else
    {
     Console.WriteLine("chyba pri inicializaci oblasti");
    }

   }

   return;
  }
 }
}
